<script setup lang='ts'>
  import { nextTick, reactive, ref } from 'vue';
  import { MoreActionsApi } from '@/api/controller';
  import xmUpload from '@/components/Upload/xm-upload.vue';
  import { ToastSuccess, Toastloading } from '@/utils/public';
  const formLabelWidth = '120px'
  const dataForm = ref()
  const $emit = defineEmits(['updateList'])
  const action = reactive({
    dialogFormVisible:false,
    disabled:false
  })
  interface formQuert {

  }
  let form = reactive({} as formQuert)
  const formRules = {
    sendtime: [{ required: true, trigger: 'blur', message: '请选择预计发送时间' }],
  }
  const handleSubmit = ()=>{
    dataForm.value.validate(async(valid:any)=>{
      if(!valid) return

      
    })
  }
  const openDialog = (query:any = {})=> {

    action.dialogFormVisible = true
  }
  const closeDialog = ()=>{
    form = reactive({} as formQuert)

    nextTick(() => {
      dataForm.value.clearValidate();
    });
    action.dialogFormVisible = false
  }
  defineExpose({
    openDialog
  })
</script>

<template>
  <div>
    <el-dialog
    top="5vh"
    class="xm-dialog input-width"
    v-model="action.dialogFormVisible"
    :close-on-click-modal="action.disabled"
    :show-close="action.disabled"
    :close-on-press-escape="action.disabled"
    width="60%"
    title="消息发送">
      <el-form ref="dataForm" :model="form" :rules="formRules">
        
      </el-form>

      <template v-if="!action.disabled" #footer>
        <span class="dialog-footer">
          <el-button @click="closeDialog">取 消</el-button>
          <el-button type="primary" @click="handleSubmit()">确 定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>